#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
//int main()
//{
//	printf("Hello World\n");
//	return 0;
//}

int main()
{
	double deg = 0;
	char ch = 0;
	scanf("%lf%c", &deg, &ch);
	if (ch == 'C')
	{
		double deg_1 = 1.8 * deg + 32;
		printf("%.1lfF", deg_1);
	}
	else
	{
		double deg_2 = (deg - 32) / 1.8;
		printf("%.1lfC", deg_2);
	}
	return 0;
}